package com.kaver.core.common.constant.state;

/**
 * 配置的状态
 *
 * @author Roc
 * @Date 2017年1月22日 下午12:14:59
 */
public enum ChangeType {
	 OLD(0, "不变"),
    ADD(1, "新增"),
    UPDATE(2, "更新"),
	DEL(3,"删除");

    Integer code;
    String message;

    ChangeType(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static String valueOf(Integer status) {
        if (status == null) {
            return "";
        } else {
            for (ChangeType s : ChangeType.values()) {
                if (s.getCode() == status) {
                    return s.getMessage();
                }
            }
            return "";
        }
    }
}
